module aframe
import StdEnv, japi

:: Stt= {fr::!F, xbt::!TDev}


Start world
  # (js, world)= begin_japi world
  # (frm, js)= jnewFrame (XYWH 100 100 300 200) "Hello" js
  # (exec, js) = jnewButton (XY 50 150)  "Exec" frm js
  # (frm, js)= jshow frm js
  # s= {fr= frm, xbt= exec}
  # js= loop s js
  = end_japi js world
  
loop :: !Stt !*JS -> *JS
loop s js
  # (na, js)= jnextaction js
  | na== act s.fr= jquit js
  | na== act s.xbt= jquit js
  = loop s js